package com.tddx.activiti.business.${minpckage}.service.${maxpckage};

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.tddx.activiti.base.BaseService;
import com.tddx.activiti.business.${minpckage}.dao.${maxpckage}.${daoName};
import com.tddx.activiti.business.${minpckage}.dao.${maxpckage}.${jdbcName};
import com.tddx.activiti.business.${minpckage}.entity.${maxpckage}.${entityName};

/**
 * service layer 服务层 
 * @Auth yanweizhao 
*/
@Service
public class ${serviceName} extends BaseService<${entityName}, String>{

	@Autowired private ${daoName} dao;
	@Autowired private ${jdbcName} jdbc;
	
	public ${entityName} findOne(Long id){
		${entityName} entity = dao.findOne(id);
		return entity;
	}
	
	public ${entityName} save(${entityName} entity){
		entity = dao.saveAndFlush(entity);
		return entity;
	}
	
	public void delete(String ids){
		for(String idStr: ids.split(",")){
			Long id = Long.valueOf(idStr);
			${entityName} entity = dao.findOne(id);
			entity.setVcDel("1");
		}
	}
	
	public Object findList(){
		Object obj = jdbc.findListByCondition();
		return obj;
	}
	
}
